package com.itheima.ergodicSet;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        Collection<Movie> movies = new ArrayList<>();
        movies.add(new Movie("肖生克的舅叔","弗兰克","萝卜丝",9.7,"犯罪","2370658人评价"));
        movies.add(new Movie("霸王别姬","陈凯歌","张国荣",9.6,"同性","1765515人评价"));
        movies.add(new Movie("阿甘正传","萝卜特","汤姆",9.6,"美国","1786600人评价"));

        for (Movie movie : movies) {
            System.out.println(movie);
        }
        System.out.println("---------------------------------------------");
        Iterator<Movie> iterator = movies.iterator();
        while (iterator.hasNext()) {
            Movie movie =  iterator.next();
            System.out.println(movie);

        }

    }
}
